package com.ctsi.security.manager.impl;

import java.io.Serializable;
import java.util.*;

public class CachePermission implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 138779679959094530L;
	// 具有该permission的角色列表
	private List<String> roleId;
	// permission对应的功能类型
	private String permType;
	// permission对应的功能类型对应的数据对象类型
	private String doType;
	// 具有该permission的角色,数据对象列表
	private Map<String, CacheDataObject> mapRoleDO = null;

	public String getPermType() {

		return permType;
	}

	public void setPermType(String permType) {
		if (permType == null)
			this.permType = "";
		else
			this.permType = permType;
	}

	public String getDoType() {

		return doType;
	}

	public void setDoType(String doType) {
		if (doType == null)
			this.doType = "";
		else

			this.doType = doType;
	}

	public List<String> getRoleId() {

		if (roleId==null)
			return Collections.<String>emptyList();
		return Collections.unmodifiableList(roleId);
	}

	public void setRoleId(List<String> roleId) {
		if (roleId == null)
			this.roleId = new ArrayList<String>();
		else

			this.roleId = roleId;
	}

	public Map<String, CacheDataObject> getMapRoleDO() {
		if (mapRoleDO==null)
			return Collections.emptyMap();
		return Collections.unmodifiableMap(mapRoleDO);
	}

	public void setMapRoleDO(Map<String, CacheDataObject> mapRoleDO) {
		if (mapRoleDO == null)
			this.mapRoleDO = new HashMap<String, CacheDataObject>();
		else

			this.mapRoleDO = mapRoleDO;
	}

}
